package net.media.datafw.transport.utils;

public class TransporterUtil {
	public static boolean[] converBooleanArray(Boolean[] data) {
		boolean[] toRet = new boolean[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].booleanValue();
		}
		return toRet;
	}

	public static byte[] converByteArray(Byte[] data) {
		byte[] toRet = new byte[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].byteValue();
		}
		return toRet;
	}

	public static char[] converCharacterArray(Character[] data) {
		char[] toRet = new char[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].charValue();
		}
		return toRet;
	}

	public static short[] converShortArray(Short[] data) {
		short[] toRet = new short[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].shortValue();
		}
		return toRet;
	}

	public static int[] converIntegerArray(Integer[] data) {
		int[] toRet = new int[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].intValue();
		}
		return toRet;
	}

	public static long[] converLongArray(Long[] data) {
		long[] toRet = new long[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].longValue();
		}
		return toRet;
	}

	public static float[] converFloatArray(Float[] data) {
		float[] toRet = new float[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].floatValue();
		}
		return toRet;
	}

	public static double[] converDoubleArray(Double[] data) {
		double[] toRet = new double[data.length];
		for (int i = 0; i < data.length; i++) {
			toRet[i] = data[i].doubleValue();
		}
		return toRet;
	}

}
